<template>
    <div>
      <Card  title="试卷信息">
           <Row>
       <div>
      <Input search enter-button="Search" placeholder="Enter something..." />
         <Table highlight-row ref="currentRowTable" :columns="columns3" :data="data1"></Table><br/>
        <Button type="primary"  @click="exportData"><Icon type="ios-download-outline"></Icon>导出考卷试题</Button></div>
         </Row>
      </Card>
    </div>
</template>
<script>
export default {
    data () {
      return {
        examPage:[],
         columns3:[ {   
                        renderHeader:(h,params)=> {
                        return h('div','考试信息:'+this.examPage.examInfo)
                    },

                        children:[
                    {
                        title: '序号',
                        key:'index',
                        width: 60,
                        align: 'center',
                    },
                    {
                        title: '问题',
                        width: 400,
                        align:'center',
                        tooltip:true,
                        key: 'question'
                    },
                    {
                        title: '选项A',
                        key: 'A'
                    },
                    {
                        title: '选项B',
                        key: 'B'
                    },
                       {
                        title: '选项C',
                        key: 'C'
                    },
                       {
                        title: '选项D',
                        key: 'D'
                    },
                       {
                        title: '单选答案',
                        key: 'Right1'
                    },
                       {
                        title: '多选答案',//[this.data1[params.index].Right2]
                        key:'Right2',
                        width:'100px',
                      render:(h,params)=> {
                         return h('span',this.data1[params.index].Right2)
                      },
                    },
                       {
                        title: '分值',
                        key: 'singleValue'
                    }
                ]}],
                data1: []
        }
},
    methods: {
         exportData() {
             this.$refs.currentRowTable.exportCsv({
                        filename: '导出考卷试题'
                    });
            }

    },
  mounted() {
      let a=this.$route.query.Msg
      this.examPage=a
   let b=[...a.singleChoiceData,...a.multiChoiceData]
   b.map((item,index)=>{
    item.index=index+1
    return item
   })
   this.data1=b
  },
}
</script>
<style scoped>




</style>